Add mp_show_hintmessages cvar to allow blocking hint messages server-side#1166
Add mp_show_hintmessages cvar to allow blocking hint messages server-side#1166belomaxorka wants to merge 2 commits into
mp_show_hintmessages cvar to allow blocking hint messages server-side#1166Conversation
mp_show_hintmessages cvar to allow blocking hint messages server-side
|
ty for PR! issue is: i am not sure, but maybe better to shift this responsibility to plugins |
Allows servers to suppress all Hint_* messages (HintMessageEx queue) without a plugin. Default 1 keeps vanilla behavior. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Move the cvar check below the IsAlive gate and skip it when bOverride is set, so it acts as a server-side sibling of the client _ah (auto-help) preference rather than an unconditional block. The hook chain terminal (HintMessageEx OrigFunc) still runs after all plugin hooks, so RG_CBasePlayer_HintMessageEx keeps firing for vanilla events. And because bOverride already bypasses m_bShowHints today, ReAPI callers that need guaranteed delivery (rg_hint_message with override) keep their existing escape hatch — no new contract is broken. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
35b4419 to
4f1ba0f
Compare
Thanks for the detailed breakdown — you're right that there's no clean way to do vanilla-only suppression on the gamedll side. Both vanilla and plugin hints funnel through the same CBasePlayer::HintMessageEx, so there's no origin signal to key on, and gating at the call sites would hide vanilla events from RG_CBasePlayer_HintMessageEx hooks. I've reframed the change rather than trying to solve the unsolvable case. The cvar is now positioned as a master kill-switch, not a vanilla-only filter:
I fully agree this doesn't cover every case, and forcing a hint against the server's wishes is reasonably a plugin's responsibility. So I'm leaving the call to you (@s1lentq) — if you feel this doesn't belong in the core and is better left to third-party plugins, please go ahead and close the PR. No hard feelings at all. |
What
Adds a new cvar
mp_show_hintmessages(default1) that allows servers to disable sending hint messages (#Hint_*) to clients.Why
Server operators often want to get rid of the tutorial-style hint popups (e.g.
#Hint_you_have_the_bomb,#Hint_spotted_an_enemy, zone hints). Currently this requires a plugin that hooksRG_CBasePlayer_HintMessageExand supersedes it. Since every hint goes through a single function, this is trivial to support natively.How it works
All hint messages are routed through
CBasePlayer::HintMessageEx()(both directly and via theHintMessage()wrapper) before being queued intom_hintMessageQueue. Whenmp_show_hintmessagesis0,HintMessageEx()returnsfalseimmediately, so nothing is queued and nothing is sent to the client. The check is underREGAMEDLL_ADD; default value1keeps vanilla behavior.Edge cases
#Got_bomb) are not affected - they are not hints and bypass the hint queue by design.RG_CBasePlayer_HintMessageExstill fires as before; the cvar check is inside the hooked function body, so plugins keep working.m_bShowHints) is untouched; the cvar acts as a server-wide override on top of it.Tested
Built Win32 Release (MSVC) and verified on a listen/dedicated ReHLDS server: with the cvar at
1the bomb pickup hint is shown as usual; aftermp_show_hintmessages 0(changeable at runtime) no hints are delivered, while center messages remain intact.